package cn.iocoder.yudao.module.trade.dal.mysql.orderpostconfig;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.trade.dal.dataobject.orderpostconfig.OrderPostConfigDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.trade.controller.admin.orderpostconfig.vo.*;

/**
 * 订单回传扣量配置 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface OrderPostConfigMapper extends BaseMapperX<OrderPostConfigDO> {

    default PageResult<OrderPostConfigDO> selectPage(OrderPostConfigPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<OrderPostConfigDO>()
                .eqIfPresent(OrderPostConfigDO::getConfigType, reqVO.getConfigType())
                .eqIfPresent(OrderPostConfigDO::getDrainageType, reqVO.getDrainageType())
                .eqIfPresent(OrderPostConfigDO::getConfigValue, reqVO.getConfigValue())
                .eqIfPresent(OrderPostConfigDO::getSort, reqVO.getSort())
                .eqIfPresent(OrderPostConfigDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(OrderPostConfigDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(OrderPostConfigDO::getId));
    }

}